import { IType } from "@/interface/IShape";
import { BaseShape } from "./BaseShape";

export class ImageShape extends BaseShape {
  /* 原图，需要存储到服务器上 */
  src: string;

  /* 是否抖动[请求] */
  keep: boolean;

  /* 是否转黑白[请求/本地] */
  bw: boolean;

  /* 临时缓存，用于显示抖动等效果 */
  cacheSrc: string;

  rotate: number;

  constructor() {
    super();
    this.src = "";
    this.keep = false;
    this.bw = false;
    this.cacheSrc = "";
    this.w = 60;
    this.h = 60;
    this.rotate = 0;
    this.type = IType.IMAGE;
  }
}

export class DImageShape extends ImageShape {
  constructor() {
    super();
    this.type = IType.DIMAGE;
  }
}
